package com.czy.moudle.exception.domain.enums;

/***
 * 异常分类
 *
 * @author 陈致远
 * @date 2016/8/11
 */
public enum Level {
    info("info", "信息")
    ,warn("warn", "告警")
    ,error("error", "错误");

    private String content;
    private String name;

    Level(String name, String content){
        this.content = content;
        this.name = name;
    }

    public static Level getByName(String name){
        for(Level level : Level.values()){
            if(level.getName().equals(name)){
                return level;
            }
        }

        return null;
    }

    public String getName() {
        return name;
    }

    public String getContent() {
        return content;
    }
}
